<?php
// error_reporting(0);
// ini_set("display_errors", "On");
// error_reporting(E_ALL | E_STRICT);
header('Content-Type: text/html; charset=utf-8');
date_default_timezone_set('PRC'); 


/**
 * auth:半支烟
 * QQ:50309532
 * email:50309532@qq.com
 * 开发时间：2015-08-01
 * 协助开发人员：
 * 说明：此框架为半支烟独立开发，您可随意使用，但请使用前先加开发者的QQ，以便共同维护，并指导框架中存在的不足，一起进步。
 * 谢谢 
 */


include "common/func.php";
include CONTROL."/CControl.class.php";
include DATAMODEL."/DBData.class.php";
header('Access-Control-Allow-Origin: *'); 
$actionControl = geturlbaseArr();
if(!isset($actionControl[1]))
{
	$actionControl[1] = 'index';
}

if(!isset($actionControl[1]))
{
	$actionControl[1] = 'index';
}
$a1 = $actionControl[1];
if($a1 === 'new')
{
	$total = count($actionControl);
	for($i=2;$i<=$total;$i++)
	{
		$actionControl[$i-1] = $actionControl[$i];
	}
	unset($actionControl[$total]);
	$a1 = $a1.'_';
}else
{
	$a1 = '';
}

define('URIBASE',json_encode($actionControl)) ;
$control = $a1.ucfirst($actionControl[1])."Control";
$_action = $actionControl[2];
$action = $_action."Action";
if(class_exists($control))
{
	$class = new $control();
	$class->$action();
}else
{

	echo "noclass";
	
//	$errorC = new ErrorControl();
//	$errorC->indexAction();
}
?>